import request from '@/utils/http'
import type { InterviewRequest, EvaluationRequest, EvaluationPost, EvaluationsRequest, EvaluationByEidRequest } from '../types/home.d'

//获取面试
export function getInterview(params: InterviewRequest) {
   return request.get('/meeting/getInterView', { params });
}
//获取该面试的评价
export function getEvaluation(params: EvaluationRequest) {
   return request.get('/meeting/getEvaluation', { params });
}
//提交评价
export function submitEvaluation(params: EvaluationPost) {
   return request.post('/meeting/submitEvaluation', params);
}
//获取面试官当天已反馈评价
export function getEvaluations(params: EvaluationsRequest) {
   return request.get('/meeting/getEvaluationById', { params });
}
//点击单条评价获取详细信息 
export function getEvaluationByEid(params: EvaluationByEidRequest) {
   return request.get('/meeting/getEvaluationByEid', { params });
}

//获取当前登录应聘者的信息
export function getIntervieeInfo() {
   return request.get('/meeting/getByToken');
}

//根据面试id获取面试信息
export function getInterviewById(params: any) {
   return request.post(`/meeting/getInterviewById`,params);
}

//上传简历
export function uploadjl(file: any, userId: string, interviewId: string) {
   const formData = new FormData();
   formData.append('file', file);
   return request({
      url: `/meeting/uploadjl?userId=${userId}&interviewId=${interviewId}`,
      method: 'POST',
      data: formData,
      headers: {
         'Content-Type': 'multipart/form-data'
      }
   });
}


